import request from '@/utils/request'

const api_name = '/oj/category'

export default {
  // 创建试题分类
  createCategory(categoryName) {
    return request({
      url: `${api_name}`,
      method: 'post',
      param: { categoryName }
    })
  },
  // 查看所有试题分类（不会很多，不用分页）
  getAllCategorys() {
    return request({
      url: `${api_name}/list`,
      method: 'get'
    })
  },
  // 删除试题分类
  deleteCategory(categoryId) {
    return request({
      url: `${api_name}/categoryId`,
      method: 'delete'
    })
  }
}
